#include <QtGui>
#include <QTranslator>
#include <QtCore/QTextCodec>
#include "gv_setuptimedialog.h"
#include "gv_setupdatedialog.h"
#include "gv_setuptimezonedialog.h"
#include "gv_home.h"
#include "gv_setupdetailedviewdialog.h"
#include "gv_setting.h"

extern GV_Setting *gvsetting;
extern QDialog  *dialog;
GV_SetupDetailedViewDialog::GV_SetupDetailedViewDialog(QWidget *parent)
       : QDialog(parent)
{
    setupUi(this);

    QTranslator translator;
    translator.load(gvsetting->GV_GetLanguage(),".");
    qApp->installTranslator(&translator);
    reloadtext();

    TimeHintsLabel->setText((QDateTime::currentDateTime().toString("hh:mm:ss")));
    DateHintsLabel->setText((QDateTime::currentDateTime().toString("yyyy-MM-dd")));

    timer = new QTimer;
    connect(timer,SIGNAL(timeout()),this,SLOT(GV_chTime()));
    connect(BackButton,SIGNAL(clicked()),this,SLOT(cancel()));
    connect(CancelButton,SIGNAL(clicked()),this,SLOT(cancel()));
    connect(HelpButton,SIGNAL(clicked()),this,SLOT(accept()));


    timer->start(1000);
}
void GV_SetupDetailedViewDialog::reloadtext()
{
    //NameHintsLabel->setText(tr("Zones"));
}
void GV_SetupDetailedViewDialog::GV_chTime()
{
    TimeHintsLabel->setText((QDateTime::currentDateTime().toString("hh:mm:ss")));
    DateHintsLabel->setText((QDateTime::currentDateTime().toString("yyyy-MM-dd")));
}


void GV_SetupDetailedViewDialog::cancel()
{
    QDialog *dialog1 = new GV_SetupTimezoneDialog;
    dialog1->show();
    delete dialog;
    dialog = dialog1;
}
